Skip to content

Feature. Commando Context#8

Merged
SerhiiRI merged 3 commits intomainfrom
feat-command-context
Mar 11, 2026
Merged

Feature. Commando Context#8
SerhiiRI merged 3 commits intomainfrom
feat-command-context

Conversation

@SerhiiRI
Copy link
Copy Markdown
Contributor

@SerhiiRI SerhiiRI commented Mar 7, 2026

TLDR

(:instruction
 (commando/execute
   [command-builtin/command-from-spec
    (command-builtin/command-context-spec
      {:theme-configuration {:background-color "#FF0000"
                             :color "#040404"}})]
   {:button-style 
    {:background-color {:commando/context [:theme-configuration :background-color]}
     :color            {:commando/context [:theme-configuration :color]}
     :border           {:commando/context [:theme-configuration :border] :default "1px solid red"}}}))
;; => 
{:button-style
 {:background-color "#FF0000",
  :color "#040404",
  :border "1px solid red"}}

command-builtin/command-context-spec - the first "dynamic" command, which just enclose data inside and gave access via :commando/context. In practice user easily may create it's own context by copying code of this one. To enclose his own , maybe even mutable types/object what can even increase performance. Context have :none dependency, what also dont overload dependency managment logic.

This solution is ready architectural solution what indeed help user to concentrate on the flow inside of instruction and hide ennecessary or unsecured stuffs. With help of Registry overriding it may significantly increase perfrormance on the frontend where commando may run in cycle multiple time at a second, because operatoin very cheap by design.

@SerhiiRI SerhiiRI self-assigned this Mar 7, 2026
@SerhiiRI SerhiiRI requested a review from Kaspazza March 7, 2026 23:55
@SerhiiRI SerhiiRI changed the base branch from main to feat-registry-redesign March 7, 2026 23:56
@SerhiiRI SerhiiRI force-pushed the feat-registry-redesign branch from 01b532d to 60232a6 Compare March 9, 2026 16:14
@SerhiiRI SerhiiRI force-pushed the feat-command-context branch from ca7d56a to 1c17955 Compare March 9, 2026 16:14
…ure of step execution and handle warning text about the skipping procedure
@SerhiiRI SerhiiRI force-pushed the feat-command-context branch from 1c17955 to 4cd09f9 Compare March 11, 2026 00:06
(update :internal/cm-running-order registry/remove-runtime-registry-commands-from-command-list)
(update :registry registry/reset-runtime-registry))))

(defn ^:private crop-final-status-map [status-map]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used

@Kaspazza
Copy link
Copy Markdown
Contributor

Minor comments, very good change!

Base automatically changed from feat-registry-redesign to main March 11, 2026 16:16
@SerhiiRI SerhiiRI merged commit 480b9fb into main Mar 11, 2026
@SerhiiRI SerhiiRI deleted the feat-command-context branch March 11, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants